home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / Quill / Source / ResourceNode.h < prev    next >
C/C++ Source or Header  |  1997-01-31  |  2KB  |  89 lines

  1. /*
  2.  *  File:       ResourceNode.h
  3.  *  Summary:       Abstract base class CResourceTable nodes.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->     1/17/96    JDJ        Created
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <ZBaseTableNode.h>
  17.  
  18. #include "ResourceMap.h"
  19.  
  20.  
  21. // ===================================================================================
  22. //    class CResourceNode
  23. // ===================================================================================
  24. class CResourceNode : public TBaseTableNode {
  25.  
  26.     typedef TBaseTableNode Inherited;    
  27.  
  28. //-----------------------------------
  29. //    Initialization/Destruction
  30. //
  31. public:
  32.     virtual             ~CResourceNode();
  33.     
  34.                         CResourceNode(THierarchicalTable* table, CResourceMap* rsrcMap);
  35.  
  36.                         CResourceNode(THierarchicalTable* table, TSubNode* parent, 
  37.                                       CResourceMap* rsrcMap, ResID id);
  38.                                       
  39.     virtual CResourceNode* Make(TSubNode* parent, ResID id) = 0;
  40.                         
  41. //-----------------------------------
  42. //    New API
  43. //
  44. public:
  45.     virtual void         EditResource() = 0;
  46.     
  47.     virtual void         UpdateResource() const;
  48.     
  49.             CResourceMap* GetMap() const                {return mRsrcMap;}
  50.  
  51.             ResID         GetID() const                    {return mID;}
  52.             
  53.             void         SetID(ResID id)                    {mID = id;}
  54.             
  55.             SResource     GetResource() const                {return mRsrcMap->GetResource(mID);}
  56.     
  57. //-----------------------------------
  58. //    TBaseTableNode API
  59. //
  60. public:
  61.     virtual TLongSize     GetSize() const;
  62.         
  63. protected:
  64.     virtual void         OnDraw(TCanvas& canvas, const TRect& bounds);
  65.  
  66.     virtual bool         OnMouseDown(const TMouseEvent& event);
  67.  
  68.     virtual bool         OnContextMenu(const TMouseEvent& event);
  69.  
  70.     virtual bool         OnKeyDown(const TKeyEvent& event);
  71.  
  72.     virtual bool         OnMenuCommand(const MenuCommand& command);
  73.         
  74.     virtual bool         OnCommandStatus(const MenuCommand& command, SCommandStatus& status);
  75.  
  76. //-----------------------------------
  77. //    Member data
  78. //
  79. protected:
  80.     CResourceMap*    mRsrcMap;
  81.     ResID            mID;
  82.     
  83.     TTextTrait        mTextTraits;
  84. };
  85.  
  86.  
  87.  
  88.  
  89.